import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;


public class ExOnMoveFiles {

	public static void main(String[] args) throws IOException {
		
		System.out.println("Enter source Distination");
		BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));
		String source = bufferRead.readLine();
		String dest = bufferRead.readLine();
		System.out.println("Source"+source+""+"dest"+dest);
		File file1 = new File(source);
		//File file2 = new File(dest);
		File listFiles[] = file1.getCanonicalFile().listFiles();
		System.out.println("canonical path>>>"+file1.getCanonicalPath());
		if (listFiles.length != 0) {
			try {
				for (int i = 0; i < listFiles.length; i++) {
					File file2 = new File(dest+File.separator+listFiles[i].getName());
					boolean flag = listFiles[i].renameTo(file2);
					System.out.println(flag);
				}
			} catch (Exception e) {
				e.getStackTrace();
			}
		}
		
	    
	}
}
